/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.skydoves.preferenceroomdemo;

import com.skydoves.preferenceroomdemo.components.PreferenceComponent_AppComponent;
import junit.framework.TestCase;
import org.junit.Assert;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class AppComponentTest extends TestCase {
    private PreferenceComponent_AppComponent appComponent;

    @Test
    public void testComponentInitialize() {
        appComponent = PreferenceComponent_AppComponent.getInstance();
        Assert.assertNotNull(PreferenceComponent_AppComponent.getInstance());
    }

    @Test
    public void testEntityInitialize() throws Exception {
        appComponent = PreferenceComponent_AppComponent.getInstance();
        Assert.assertNotNull(appComponent.UserProfile());
        Assert.assertNotNull(appComponent.UserDevice());
    }

    @Test
    public void testEntityList() throws Exception {
        appComponent = PreferenceComponent_AppComponent.getInstance();
        assertThat(appComponent.getEntityNameList().get(0).toString(), is("UserProfile"));
        assertThat(appComponent.getEntityNameList().get(1).toString(), is("UserDevice"));
    }

}
